package com.zat.mes.andrmes.dofun


import android.view.View
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.zat.mes.andrmes.BomNotifiBean
import com.zat.mes.andrmes.R
import com.zat.mes.andrmes.base.BaseActivity
import com.zat.mes.andrmes.data.DayPlanNotifBean
import com.zat.mes.andrmes.dofun.main.adapter.BomNotifiAdapter
import com.zat.mes.andrmes.dofun.main.adapter.NotifiAdapter
import kotlinx.android.synthetic.main.activity_notification.*
import kotlinx.android.synthetic.main.layout_title.*

class BomNotifiActivity : BaseActivity() {

    override fun init() {
        initView()
        initData()
    }

    private fun initData() {
        val parcelableArrayListExtra =
            intent.getParcelableArrayListExtra<BomNotifiBean>("bomList")
        val notifiAdapter = BomNotifiAdapter(R.layout.item_bom_notifi)
        rvNotifi.layoutManager = LinearLayoutManager(this)
        rvNotifi.addItemDecoration(DividerItemDecoration(this,DividerItemDecoration.VERTICAL))
        rvNotifi.adapter = notifiAdapter
        notifiAdapter.setNewData(parcelableArrayListExtra)
    }

    private fun initView() {
        setContentView(R.layout.activity_notification)
        tVtitle.text = "物料通知"
        rlReturnTitle.visibility = View.VISIBLE
        rlReturnTitle.setOnClickListener { finish() }
    }

}